

#import <Foundation/Foundation.h>
#import "ASIHttpRequest.h"
#import "ASIFormDataRequest.h"

@class FileUploader;

@protocol FileUploaderDelegate<NSObject>

- (void)uploadedImage:(NSString*)URL sender:(FileUploader*)sender;

@end


@interface FileUploader : NSObject <NSXMLParserDelegate>
{
	NSMutableData*	result;
	id <FileUploaderDelegate> delegate;
	id userData;
	
//	NSURLConnection *connection;
//    ASIFormDataRequest *request;
	
	NSMutableString* contentXMLProperty;
	NSString*		anewURL1;
	BOOL			canceled;
	BOOL			scaleIfNeed;
	
	NSString*		contentType;
    NSString*       boundary;
    
    NSString* businessID;
    NSString* fileType;
    NSString* fileName;
    NSString* fileID;
    NSString* memberID;
    NSString* uploadServer;
    NSString* businessType;
}

- (void)postJPEGData:(NSData*)imageJPEGData delegate:(id <FileUploaderDelegate>)dlgt userData:(id)data;
- (void)postMP4Data:(NSData*)movieData delegate:(id <FileUploaderDelegate>)dlgt userData:(id)data;
- (void)postImage:(UIImage*)image delegate:(id <FileUploaderDelegate>)dlgt userData:(id)data; // call postJPEGData:delegate:userData:
- (void)cancel;
- (BOOL)canceled;

-(void) uploadPic:(UIImage*) image delegate:(id <FileUploaderDelegate>)dlgt  businessType:(NSString*) bsType businessID:(NSString*) bsID fileType:(NSString*) fType fileName:(NSString*) fName memberID:(NSString*) mName;


//@property (nonatomic, retain) NSURLConnection *connection;
//@property (nonatomic, retain)ASIHTTPRequest *request;

@property (nonatomic, retain) NSMutableString* contentXMLProperty;
@property (nonatomic, retain) NSString* anewURL1;
@property (nonatomic, retain) NSString* contentType;
@property (nonatomic, retain) id userData;
@property (nonatomic, retain) id <FileUploaderDelegate> delegate;

@property (nonatomic, retain) NSString* businessID;
@property (nonatomic, retain) NSString* fileType;
@property (nonatomic, retain) NSString* fileName;
@property (nonatomic, retain) NSString* memberID;
@property (nonatomic, retain) NSString* uploadServer;
@property (nonatomic, retain) NSString* businessType;
@property (nonatomic, retain) NSString* fileID;

@end
